package com.xingxuecn.limit.service.impl;

import com.xingxuecn.limit.common.model.vo.Page;
import com.xingxuecn.limit.common.model.dto.Role;
import com.xingxuecn.limit.dao.RoleDao;
import com.xingxuecn.limit.dao.impl.RoleDaoImpl;
import com.xingxuecn.limit.service.RoleService;

import java.sql.SQLException;
import java.util.List;

/**
 * @author Kris at 2018/9/11 10:22
 */
public class RoleServiceImpl implements RoleService {
    RoleDao roleDao = new RoleDaoImpl();
    @Override
    public int add(Role role) throws SQLException {
        return roleDao.add(role);
    }

    @Override
    public int update(Role role) throws SQLException {
        return roleDao.update(role);
    }

    @Override
    public int delete(int id) throws SQLException {
        return roleDao.delete(id);
    }

    @Override
    public List<Role> search(Role role) {
        return null;
    }

    @Override
    public int count(Role role) {
        return 0;
    }

    @Override
    public Page<Role> search(Role role, int page, int rows) throws SQLException {
        return roleDao.searchPage(role,page,rows);
    }
}
